<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>鼠标移动</title>
    <script type="text/javascript">
        document.onmousemove=function(){
            //步骤1：获取当前鼠标的坐标
            var x=event.screenX;
            var y=event.screenY;

            //步骤2：把坐标显示在文本框里
            var xElement=document.getElementById('x');
            var yElement=document.getElementById('y');
            xElement.value=x;
            yElement.value=y;
        }

        document.oncontextmenu=function(){
            //禁用
//            event.keyCode=0;
//            event.returnValue=false;
//            return;
            //另一种方案
            event.preventDefault();
        }

    </script>

</head>
<body>
X:<input type="text" id="x"><br>
Y:<input type="text" id="y"><br>

</body>
</html>